//
// Created by Semir on 2020/4/22.
//

#include <iostream>
#include <algorithm>

using namespace std;

const int MAX_N = 105;
const int UNNOMAL = -99999;
int n;
int arr[MAX_N];

int main() {
    int count = 0;
    int lastIndex = 0;
    cin >> n;
    arr[0] = UNNOMAL;
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
    }
    sort(arr + 1, arr + n + 1);
    for (int i = 1; i <= n; i++) {
        if (arr[i] == arr[lastIndex]) {
            arr[i] = UNNOMAL;
        } else {
            count++;
            lastIndex = i;
        }
    }
    cout << count << endl;
    for (int i = 1; i <= n; i++) {
        if (arr[i] != UNNOMAL) {
            cout << arr[i] << " ";
        }
    }
    return 0;
}